package org.example.emun;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        // Season season = new Season("","");

        Season spring = Season.SPRING;
        System.out.println( "jdk5以下的枚举:" + spring);

        // 构造方法是private的
        // SeasonBeta seasonBeta = new SeasonBeta("", "");

        SeasonBeta summer = SeasonBeta.SUMMER;
        System.out.println( "jdk5以上的枚举:" + summer);

        SeasonTheta winter = SeasonTheta.WINTER;
        System.out.println("继承接口的枚举:" + winter);

        System.out.println("------------------------------------------------------");

        //values方法
        SeasonBeta[] values = SeasonBeta.values();
        for (SeasonBeta value : values) {
            System.out.println(value);
        }

        System.out.println("------------------------------------------------------");

        //valueOf（）方法
        SeasonBeta autumn = SeasonBeta.valueOf("AUTUMN");
        System.out.println(autumn);

        System.out.println("------------------------------------------------------");

        //演示继承接口后调用方法
        SeasonTheta.SPRING.show();
        SeasonTheta.SUMMER.show();
        SeasonTheta.AUTUMN.show();
        SeasonTheta.WINTER.show();
    }
}
